/*
 * Created on 07.10.2005
 *
 * To change the template for this generated file go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
package de.fmannan.addbook.editor.util;

import de.fmannan.addbook.editor.types.TypesUtil;


public class StringUtil {

    private StringUtil() {
        // Util is not instantiable.
    }

    public static String fromWidget(String value)
    {
        if ( value == null || value.equals("") ) {
            return TypesUtil.getInvalidString();
        }
        else {
            return value;
        }
    }

    public static String toWidget(String value) 
    {
        if ( value == null ) {
            return "";
        }
        else if ( TypesUtil.isValidString(value) ) {
            return value;
        }
        else {
            return "";
        }
    }
    
}
